<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
<!--<title><?php echo ($mob_seo['title']); ?> | <?php echo modC('WEBSITE_NAME','OpenSNS','Mob');?></title>  -->
<title> 有乎儿</title>
<meta name="keywords" content="<?php echo ($mob_seo['keywords']); ?>">
<meta name="description" content="<?php echo ($mob_seo['description']); ?>">

<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp"/>

<script src="/os/Application/Mob/Static/js/jquery.min.js"></script>
<script src="/os/Application/Mob/Static/js/amazeui.min.js"></script>
<script src="/os/Public/js/com/com.functions.js"></script>
<script src="/os/Application/Mob/Static/js/toast.js"></script>
<script src="/os/Application/Mob/Static/js/apps/base.js"></script>


<script src="/os/Public/js/ext/magnific/jquery.magnific-popup.min.js"></script>
<script src="/os/Application/Mob/Static/js/toastr/toastr.min.js"></script>
<script src="/os/Application/Mob/Static/js/toast.js"></script>
<script src="/os/Application/Mob/Static/js/dist/lrz.mobile.min.js"></script>

<link rel="stylesheet" href="/os/Application/Mob/Static/css/amazeui.min.css"/>




<link rel="stylesheet" href="/os/Application/Mob/Static/css/app.css"/>
<link rel="stylesheet" href="/os/Application/Mob/Static/js/toastr/toastr.min.css" />
<link rel="stylesheet" href="/os/Application/Mob/Static/js/diyUpload.css"/>
<link rel="stylesheet" href="/os/Application/Mob/Static/css/apps/core.css"/>
<link rel="stylesheet" href="/os/Public/js/ext/magnific/magnific-popup.css"/>
<link rel="alternate icon" type="image/png" href="assets/i/favicon.png">
<!--用于加载顶部css和js-->
<?php $config = api('Config/lists'); C($config); $count_code=C('_MOB_STATISTICALCODE'); if(empty($count_code)){ $count_code=C('COUNT_CODE'); } ?>

<script type="text/javascript">
    //全局内容的定义
    var _ROOT_ = "/os";
    var MID = "<?php echo is_login();?>";
    var MODULE_NAME="<?php echo MODULE_NAME; ?>";
    var ACTION_NAME="<?php echo ACTION_NAME; ?>";
    var CONTROLLER_NAME ="<?php echo CONTROLLER_NAME; ?>";
    var ThinkPHP = window.Think = {
        "ROOT": "/os", //当前网站地址
        "APP": "/os/index.php?s=", //当前项目地址
        "PUBLIC": "/os/Public", //项目公共目录地址
        "DEEP": "<?php echo C('URL_PATHINFO_DEPR');?>", //PATHINFO分割符
        "MODEL": ["<?php echo C('URL_MODEL');?>", "<?php echo C('URL_CASE_INSENSITIVE');?>", "<?php echo C('URL_HTML_SUFFIX');?>"],
        "VAR": ["<?php echo C('VAR_MODULE');?>", "<?php echo C('VAR_CONTROLLER');?>", "<?php echo C('VAR_ACTION');?>"],
        'URL_MODEL': "<?php echo C('URL_MODEL');?>",
        'WEIBO_ID': "<?php echo C('SHARE_WEIBO_ID');?>"
    }

    var weibo_comment_order = "<?php echo modC('COMMENT_ORDER',0,'WEIBO');?>";
</script>

<script>
    //全局内容的定义
    var _LOADING_ = "/os/Application/Mob/Static/images/loading.jpg";
</script>
    </head>
    <body>
        <!-- 头部 -->
        <?php D('Member')->need_login(); ?>
<style>
    .header {
        text-align: center;
    }

    .header h1 {
        font-size: 200%;
        color: #333;
        margin-top: 30px;
    }

    .header p {
        font-size: 14px;
    }
</style>
<div data-am-widget="header" class="am-header am-header-default am-header-fixed am-cf">
    <?php if(!empty($top_menu_list["left"])): ?><div class="am-header-left am-header-nav">

            <?php if(is_array($top_menu_list["left"])): $i = 0; $__LIST__ = $top_menu_list["left"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($i % 2 );++$i; switch($menu["type"]): case "home": ?><a href="<?php echo ($menu["href"]); ?>" class="am-fl <?php echo ($menu["a_class"]); ?>">
                            <i class="am-header-icon am-icon-home <?php echo ($menu["i_class"]); ?>"></i><?php echo ($menu["html"]); ?>
                        </a><?php break;?>
                    <?php case "back": ?><a id="goback" need-confirm="<?php echo ($menu["need_confirm"]); ?>" confirm-info="<?php echo ($menu["confirm_info"]); ?>"
                           class="<?php echo ($menu["a_class"]); ?>">
                            <span class="am-icon-chevron-left <?php echo ($menu["span_class"]); ?>"></span>
                        </a><?php break;?>
                    <?php case "message": if (is_login()) { ?>
                        <?php echo W('Mob/Message/index');?>
                        <?php } break; endswitch; endforeach; endif; else: echo "" ;endif; ?>
        </div><?php endif; ?>

    <h1 class="am-header-title <?php echo ($top_menu_list["center"]["h1_class"]); ?>">
        <i class="<?php echo ($top_menu_list["center"]["i_class"]); ?>"></i>
        <?php echo ((isset($top_menu_list["center"]["title"]) && ($top_menu_list["center"]["title"] !== ""))?($top_menu_list["center"]["title"]):"首页"); ?>
    </h1>
    <?php if(!empty($top_menu_list["right"])): ?><div class="am-header-right am-header-nav">
            <?php if(is_array($top_menu_list["right"])): $i = 0; $__LIST__ = $top_menu_list["right"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$right): $mod = ($i % 2 );++$i; switch($right["type"]): case "edit": if(isset($right['href'])): ?><a href="<?php echo ($right['href']); ?>" class="am-fl <?php echo ($right["a_class"]); ?>">
                        <!-- <a href="<?php echo U('Mob/Task/addTask');?>" class="am-fl <?php echo ($right["a_class"]); ?>"> -->

                                <i class="am-header-icon am-icon-pencil <?php echo ($right["i_class"]); ?>"></i>
                            </a>
                            <?php else: ?>
                            <script>
                                var tip_info="<?php echo ($right['info']); ?>";
                            </script>
                            <a class="am-fl <?php echo ($right['a_class']); ?>" href="javascript:void(0);" onclick="toast.error(tip_info)">
                                <i class="am-header-icon am-icon-pencil <?php echo ($right["i_class"]); ?>"></i>
                            </a><?php endif; break; endswitch; endforeach; endif; else: echo "" ;endif; ?>
            <a href="#" class="">
            </a>
        </div><?php endif; ?>
</div>
<?php if(CONTROLLER_NAME != 'Index'): ?><link href="/os/Application/Mob/Static/js/toastr/toastr.min.css" rel="stylesheet"/>

<div id="demo-view" class="" data-backend-compiled="" style="z-index: 1040">
    <nav data-am-widget="menu" class="am-menu am-menu-offcanvas1 am-no-layout" data-am-menu-offcanvas=""><a
            href="javascript: void(0)" class="am-menu-toggle"><i class="am-menu-toggle-icon am-icon-bars"></i></a>

        <div class="am-offcanvas "
             style="touch-action: pan-y; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
            <div class="am-offcanvas-bar am-offcanvas-bar-flip">
                <div class="am-text-center" id="user" style="display: none">
                    <?php $user=query_user(array('nickname','avatar64')); ?>
                    <?php $map = array('status' => array('gt', -1), 'pid' => 0,'url'=>array('eq','mob/user/index')); $list=D('MobChannel')->where($map)->find(); if($list){ ?>
                    <a style="text-indent: 0px;" href="<?php echo U('mob/user/index');?>">
                        <img class="avatar-img" style="border-radius: 100%;width:64px;margin-top:20px "
                             src="<?php echo ($user["avatar64"]); ?>">
                    </a><?php }else{ ?>
                    <a style="text-indent: 0px;" >
                        <img class="avatar-img" style="border-radius: 100%;width:64px;margin-top:20px "
                             src="<?php echo ($user["avatar64"]); ?>">
                    </a>
                    <?php } ?>

                    <div class="am-text-center">
                        <a class="am-text-truncate" style="color: #fff; width: 81px;
  display: block;
  margin: 0 auto;"><?php echo ($user["nickname"]); ?></a>
                    </div>
                </div>
                <div class="am-text-center" id="signin"
                     style="display: block;font-size: 18px ; height: 44px;line-height: 44px;">
                    <a href="<?php echo U('mob/Member/index');?>">
                        <i class="am-icon-sign-in"></i>
                        &nbsp;&nbsp;&nbsp;登录
                    </a>
                </div>
                <ul class="am-menu-nav am-avg-sm-1 am-text-center">

                    <?php $map = array('status' => array('gt', -1), 'pid' => 0,'url'=>array('neq','mob/user/index')); $list=D('MobChannel')->where($map)->select(); foreach($list as &$v ){ $v['url']=U($v['url']); } ?>
                    <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li>
                            <a style="text-indent: 0px;" href="<?php echo ($vo["url"]); ?>">
                                <i class="<?php echo ($vo["icon"]); ?>"></i>
                                &nbsp;&nbsp;&nbsp;<?php echo ($vo["title"]); ?>
                            </a>
                        </li><?php endforeach; endif; else: echo "" ;endif; ?>



                    <?php if (is_login()) { ?>
                   <!--
                    <li>
                        <a style="text-indent: 0px;" href="<?php echo U('message/index');?>" class="am-icon-bell-o">
                            <i ></i>
                            &nbsp;&nbsp;&nbsp;消息
                        </a>
                    </li>
                    -->
                    <?php } ?>
                </ul>
                <div class="am-text-center" id="signout" style="display: none;padding: 5px 0px">
                    <a>
                        <i class="am-icon-sign-out"></i>
                        &nbsp;&nbsp;&nbsp;退出
                    </a>
                </div>
            </div>
        </div>
    </nav>
</div>
<script src="/os/Application/Mob/Static/js/toastr/toastr.min.js"></script>
<script src="/os/Application/Mob/Static/js/toast.js"></script>
<script>
    var uid = '<?php echo is_login();?>';
    $(document).ready(function () {
        signout();
        if (uid > 0) {
            $('#user').show()
            $('#signin').hide()
            $('#signout').show()
        } else {
            $('#user').hide()
            $('#signin').show()
            $('#signout').hide()
        }

    });

    var signout = function () {
        $('#signout').click(function () {
            $.post("<?php echo U('Mob/Member/logout');?>", {}, function (msg) {
                if (msg.status == 1) {
                    setTimeout(function () {
                        window.location.reload();
                    }, 2000);
                    toast.success('退出成功!');
                } else {
                    toast.error(msg.info);
                }
            }, 'json')
        });
    }
</script><?php endif; ?>



        <!-- /头部 -->

        <!-- 主体 -->
        

<div id="mob-main-container" class="container">
   
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <title>任务地图</title>
    <script src="/os/Application/Mob/Static/js/addToolbar.js"></script>
    <script src="/os/Application/Mob/Static/js/weibo.js"></script>
     <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=7ea5039f30c99ced7cad2587fafab1d4&plugin=AMap.Autocomplete"></script>
    <link rel="stylesheet" href="/os/Application/Mob/Static/css/apps/weibo.css"/>
    <link rel="stylesheet" href="/os/Application/Mob/Static/css/apps/main1119.css"/>
    <style type="text/css">
        .info {


        }
        div.info-top {
            position: relative;
            top:60px;
            /* background: none repeat scroll 0 0 #F9F9F9;*/
            /*
            background: none repeat scroll 0 0 #C2C2C2;
            border-bottom: 1px solid #CCC;
            */
            background: none repeat scroll 0 0 #0e90d2;

            border-radius: 10px 10px 0 0;
            height: 31px;
            width:300px;
        }
        div.info-top div {
            display: inline-block;
            color: #fff;
            font-size: 14px;
            font-weight: bold;
            line-height: 31px;
            padding: 0 10px;
        }
        div.info-top img {
            position: absolute;
            top: 10px;
            right: 10px;
            transition-duration: 0.25s;
        }
        div.info-top img:hover {
            box-shadow: 0px 0px 5px #000;
        }
        div.info-middle {
            position: relative;
            top:60px;
            font-size: 10px;
            padding: 6px;
            height: 140px;
            width:300px;
            line-height: 16px;
        }
        div.info-bottom {
            position: relative;
            top:60px;
            /*
            background: none repeat scroll 0 0 #0e90d2;
            border-top: 1px solid #CCC;
            */
            background: none repeat scroll 0 0 #0e90d2;
            border-radius: 0 0 10px 10px ;
            color: #fff;
            height: 27px;
            width:300px;
            font-size: 10px;
            line-height:27px;


            text-align: center;
        }
        div.info-bottom img {
            position: relative;
            top:-1px;
            z-index: 104;
        }
        span {
            font-weight: bold;
            font-size: 10px;
        }
        .info-middle img {
            float: left;
            margin-right: 6px;
        }
        div.info-middle1 {
            position: relative;
            top:60px;
            font-size: 10px;
            padding:5px  0px  0px   15px;
            height: 175px;
            width:300px;
            line-height: 16px;
        }
        .info-middle1 img {

            margin-right: 15px;
            margin-bottom: 5px;
        }
    </style>
    <div class="weibo-container ">
   <div id='container'></div>
        <div id="myPageTop" style="position:absolute; top:30px; right:5px;border-radius: 2px 2px 2px 2px ;background:#0e90d2">
            <table>
                <tr>

                </tr>
                <tr>
                    <td>
                        <input type="text" placeholder="请输入关键字进行搜索" id="tipinput">
                    </td>

                </tr>
            </table>
        </div>
    <!-- <div id="tip"></div>  -->
        <div   style="width:50px;height:40px;position:absolute; top:70px; right:0px;"  class="button-group">
            <input style="background-color: #0e90d2;" type="button" class="button" value="刷新" id="addMarkers"/>
        </div>


    <div data-am-widget="navbar" class="am-navbar am-navbar-default am-cf " id="">
        <!--#32b1f1-->

        <ul class="am-navbar-nav am-cf am-avg-sm-4" style="padding: 0px;font-size: 13px;background: #0e90d2">
            <li
            <?php if(ACTION_NAME == 'index'): ?>style="background: #0f9ae0"<?php endif; ?>
            >
            <a style="color: white" href="<?php echo U('Mob/activity/actloading');?>">
                大厅
            </a>
            </li>
            <li
            <?php if(ACTION_NAME == 'hotweibo'): ?>style="background: #0f9ae0"<?php endif; ?>
            >
            <a style="color: white" href="<?php echo U('Mob/Activity/actmaploading');?>">
                地图
            </a>
            </li>
            <li
            <?php if(ACTION_NAME == 'myfocus'): ?>style="background: #0f9ae0"<?php endif; ?>
            >
            <a style="color: white" href="<?php echo U('Mob/Activity/myactivity');?>">
                我的
            </a>
            </li>
        </ul>

    </div>
<script>

</script>
<script type="text/javascript">
    longitude =eval('<?php echo $longitude;?>');
    latitude =eval('<?php echo $latitude;?>');
    var map, geolocation;
    var cluster, markers = [],markers1 = [];
    //加载地图，调用浏览器定位服务
        map = new AMap.Map('container', {
        resizeEnable: true,
        zoom:16
    });
    map.setCenter([longitude,latitude]);
    //map.setZoom(10);
    //AMap.moveCamera(CameraUpdateFactory.zoomTo(15));
    var auto = new AMap.Autocomplete({
        input: "tipinput"
    });
    AMap.event.addListener(auto, "select", select);//注册监听，当选中某条记录时会触发
    function select(e) {
        if (e.poi && e.poi.location) {
            map.setZoom(16);
            map.setCenter(e.poi.location);
        }
    }
    map.plugin('AMap.Geolocation', function() {
        geolocation = new AMap.Geolocation({
            enableHighAccuracy: true,//是否使用高精度定位，默认:true
            timeout: 10000,          //超过10秒后停止定位，默认：无穷大
            buttonOffset: new AMap.Pixel(10, 50),//定位按钮与设置的停靠位置的偏移量，默认：Pixel(10, 20)
            showMarker: true,        //定位成功后在定位到的位置显示点标记，默认：true
            showCircle: true,        //定位成功后用圆圈表示定位精度范围，默认：true
            panToLocation: false,     //定位成功后将定位到的位置作为地图中心点，默认：true
            zoomToAccuracy: false,      //定位成功后调整地图视野范围使定位位置及精度范围视野内可见，默认：false
            buttonPosition:'LB'
            //enableHighAccuracy: true,//是否使用高精度定位，默认:true
            //timeout: 10000,          //超过10秒后停止定位，默认：无穷大
            //maximumAge: 0,           //定位结果缓存0毫秒，默认：0
            //convert: true,           //自动偏移坐标，偏移后的坐标为高德坐标，默认：true
            //showButton: true,        //显示定位按钮，默认：true
            //buttonPosition: 'LB',    //定位按钮停靠位置，默认：'LB'，左下角 RB 右下角
            //buttonOffset: new AMap.Pixel(10, 20),//定位按钮与设置的停靠位置的偏移量，默认：Pixel(10, 20)
            //showMarker: true,        //定位成功后在定位到的位置显示点标记，默认：true
            //showCircle: true,        //定位成功后用圆圈表示定位精度范围，默认：true
            //panToLocation: true,     //定位成功后将定位到的位置作为地图中心点，默认：true
            //zoomToAccuracy:true      //定位成功后调整地图视野范围使定位位置及精度范围视野内可见，默认：false
        });
        map.addControl(geolocation);
        geolocation.getCurrentPosition();
        // 设置缩放级别和中心点

       // AMap.event.addListener(geolocation, 'complete', onComplete);//返回定位信息
        AMap.event.addListener(geolocation, 'error', onError);      //返回定位出错信息
     //   map.setZoomAndCenter(14,map.getCenter);

        //map.setZoom(10);



    });
    addMarker();
    //Juhe();
    addCluster(1);
    //cluster.setMap(null);

    //解析定位结果
    function onComplete(data) {
        var str=['定位成功'];
		alert('经度：' + data.position.getLng()+'纬度：' + data.position.getLat()+'精度：' + data.accuracy + ' 米');
        str.push('经度：' + data.position.getLng());
        str.push('纬度：' + data.position.getLat());
        str.push('精度：' + data.accuracy + ' 米');
        str.push('是否经过偏移：' + (data.isConverted ? '是' : '否'));
        //document.getElementById('tip').innerHTML = str.join('<br>');

    }
    //解析定位错误信息
    function onError(data) {
        document.getElementById('tip').innerHTML = '定位失败';
    }
    function CurentTime()
    {
        var now = new Date();

        var year = now.getFullYear();       //年
        var month = now.getMonth() + 1;     //月
        var day = now.getDate();            //日

        var hh = now.getHours();            //时
        var mm = now.getMinutes();          //分
        var ss = now.getSeconds();          //秒
        var clock = year + "-";

        if(month < 10)clock += "0";

        clock += month + "-";

        if(day < 10)
            clock += "0";

        clock += day + " ";

        if(hh < 10)
            clock += "0";

        clock += hh + ":";
        if (mm < 10) clock += '0';
        clock += mm + ":";
        if (ss < 10) clock += '0';
        clock += ss;

        return clock;
    }
        //实例化marker
    function addMarker() {
        //var renwushu,zhidaoxinxi=<?php echo ($tasklist); ?>;
       // renwushu=zhidaoxinxi.length;
       // var renwushu;
        dangqianshijian=CurentTime(); // "2016-06-06 07:27:44"
        dangqianshijian=dangqianshijian.substr(0,4)+dangqianshijian.substr(5,2)+dangqianshijian.substr(8,2)+dangqianshijian.substr(11,2)+dangqianshijian.substr(14,2)+dangqianshijian.substr(17,2);
        dangqianshijian=parseFloat(dangqianshijian);
        //console.log(dangqianshijian);
       // zhidaoxinxi  =eval('<?php echo json_encode($activitylist, JSON_UNESCAPED_UNICODE);?>');
        zhidaoxinxi  =eval('<?php echo json_encode($activitylist, JSON_UNESCAPED_UNICODE);?>');
        //console.log(zhidaoxinxi);
        //var renwushu = tasklist.length;

        var renwushu = zhidaoxinxi.length;
        var renwushu1=0;
        for (var i=0;i<renwushu;i++) {

            if (zhidaoxinxi[i].user.real_nickname == "" || zhidaoxinxi[i].user.real_nickname == undefined || zhidaoxinxi[i].user.real_nickname == null){
                    continue;
            }

            else  {
                renwushu1=renwushu1+1;
            zhidaoxinxi[renwushu1-1]=zhidaoxinxi[i];
            }
        }
        renwushu=renwushu1;
        var yonghuid;
        yonghusuoyin=[];
        var yonghushu,zhibiao;
        yonghuid=zhidaoxinxi[0]['sponsorUid'];
        //console.log(yonghuid);
        yonghusuoyin[0]=[];
        yonghusuoyin[0][0] = yonghuid;
        yonghusuoyin[0][1]=1;  //任务数
        yonghusuoyin[0][2] =0; //各任务在任务信息数组的位置
        yonghushu=1;
        for ( i=1;i<renwushu;i++) {
            zhibiao = 0;
            yonghuid=zhidaoxinxi[i]['sponsorUid'];
            //var fabushijian=zhidaoxinxi[i]['taskCreateTime'];
            var fabushijian=zhidaoxinxi[i]['releaseTime'];
            fabushijian=parseFloat(fabushijian.slice(0,3)+fabushijian.slice(5,6)+fabushijian.slice(8,9)+fabushijian.slice(11,12)+fabushijian.slice(14,15)+fabushijian.slice(17,18));
            //console.log(fabushijian);
            for (var j = yonghushu - 1; j > -1; j--) {
                if (yonghuid == yonghusuoyin[j][0]) {
                    yonghusuoyin[j][1] = yonghusuoyin[j][1] + 1;
                    yonghusuoyin[j][1+yonghusuoyin[j][1]] = i;
                    for (var q=0;q<yonghusuoyin[j][1]-1;q++){
                        //var fabushijian1=zhidaoxinxi[yonghusuoyin[j][2+q]]['taskCreateTime'];
                        var fabushijian1=zhidaoxinxi[yonghusuoyin[j][2+q]]['releaseTime'];
                        fabushijian1=parseFloat(fabushijian1.slice(0,3)+fabushijian1.slice(5,6)+fabushijian1.slice(8,9)+fabushijian1.slice(11,12)+fabushijian1.slice(14,15)+fabushijian1.slice(17,18));
                        if (fabushijian>fabushijian1){
                            for (var m=yonghusuoyin[j][1];m>q+1;m--){
                                yonghusuoyin[j][1+m]= yonghusuoyin[j][m];
                            }
                            yonghusuoyin[j][2+q]=i;
                            break;
                        }
                    }
                    zhibiao= 1;
                    break;
                }
            }
            if (zhibiao == 0) {
                yonghushu=yonghushu+1;
                yonghusuoyin[yonghushu-1]=[];
                yonghusuoyin[yonghushu-1][0] = yonghuid;
                yonghusuoyin[yonghushu-1][1] = 1;
                yonghusuoyin[yonghushu-1][2] = i;
            }
        }
            //yonghushu=yonghusuoyin.length;
            //console.log(yonghusuoyin);
            //console.log(yonghushu);
        var dianbiaojishu;
        dianbiaojisuoyin=[];
        dianbiaojishu=0;
        for ( i = 0; i < yonghushu; i++) {
            dianbiaojishu=dianbiaojishu+1;
            dianbiaojisuoyin[dianbiaojishu-1]=[];
            dianbiaojisuoyin[dianbiaojishu-1][0]=yonghusuoyin[i][0];
            dianbiaojisuoyin[dianbiaojishu-1][1]=1;
            dianbiaojisuoyin[dianbiaojishu-1][2]=yonghusuoyin[i][2];
            var jishu=1;
            //for( q = 0; q < yonghusuoyin[i][1]; q++){
            //    dianbiaojisuoyin[dianbiaojishu-1][2+q]=yonghusuoyin[i][2+q];
            //}
            for( j = 1; j < yonghusuoyin[i][1]; j++) {
                //yonghusuoyin[i][2+j]
                var lnglat = new AMap.LngLat(parseFloat(zhidaoxinxi[yonghusuoyin[i][2+j]]['longitude']),parseFloat(zhidaoxinxi[yonghusuoyin[i][2+j]]['latitude']));
                //console.log(lnglat);
                zhibiao=0;
                for (q=0;q<jishu;q++){
                    var juli= lnglat.distance(new AMap.LngLat(parseFloat(zhidaoxinxi[dianbiaojisuoyin[dianbiaojishu-1-q][2]]['longitude']),parseFloat(zhidaoxinxi[dianbiaojisuoyin[dianbiaojishu-1-q][2]]['latitude'])));
                    //console.log(juli);
                    if (juli<=50) {
                        dianbiaojisuoyin[dianbiaojishu-1-q][1]=dianbiaojisuoyin[dianbiaojishu-1-q][1]+1;
                        dianbiaojisuoyin[dianbiaojishu-1-q][1+dianbiaojisuoyin[dianbiaojishu-1-q][1]]=yonghusuoyin[i][2+j];
                        zhibiao=1;
                        break;
                    }
                }
                if (zhibiao==0){
                    jishu=jishu+1;
                    dianbiaojishu=dianbiaojishu+1;
                    dianbiaojisuoyin[dianbiaojishu-1]=[];
                    dianbiaojisuoyin[dianbiaojishu-1][0]=yonghusuoyin[i][0];
                    dianbiaojisuoyin[dianbiaojishu-1][1]=1;
                    dianbiaojisuoyin[dianbiaojishu-1][2]=yonghusuoyin[i][2+j];
                }
            }
        }
        //console.log(dianbiaojisuoyin);
            infoWindow = new AMap.InfoWindow({
               isCustom: true,  //使用自定义窗体
               offset: new AMap.Pixel(14, -80)
            });
            for ( i = 0; i < dianbiaojishu; i++) {
                //marker="marker"+i;
                //console.log(marker);
                var markerposition=[parseFloat(zhidaoxinxi[dianbiaojisuoyin[i][2]]['longitude']),parseFloat(zhidaoxinxi[dianbiaojisuoyin[i][2]]['latitude'])];
                var touxiang=zhidaoxinxi[dianbiaojisuoyin[i][2]]['user']['avatar32'];
                //var touxiang='<img src="'+zhidaoxinxi[dianbiaojisuoyin[i][2]].user.avatar32+'"'+'style="border-radius:50%">';
                //console.log(markerposition);
                //console.log(touxiang);
                var weizhi=["top:30px; left:-2px;","top:8px; left:7px;","top:-2px; left:30px;","top:8px; left:52px;","top:30px; left:61px;","top:51px; left:52px;","top:61px; left:30px;"];

                var yangshi= '<div >' +
                        '<img style="border-radius:50%;z-index:1;" src="Public/images/toumingbeijing.png" height="80" width="80" />' +
                        '<img src='+touxiang+' height="40" width="40" style="position:absolute; top:20px; left:20px; z-index:2;border:2px solid #fff;border-radius:50%"/>';

                var shijian=zhidaoxinxi[dianbiaojisuoyin[i][2]]['releaseTime'];
                shijian=shijian.substr(0,4)+shijian.substr(5,2)+shijian.substr(8,2)+shijian.substr(11,2)+shijian.substr(14,2)+shijian.substr(17,2);
                shijian=parseFloat(shijian);
                var qq=0;
                if (zhidaoxinxi[dianbiaojisuoyin[i][2]].user.usertype==4){
                    qq=qq+1;
                    yangshi=yangshi+'<img src="Public/images/zhidaogehong.gif" height="21" width="21" style="position:absolute; '+weizhi[qq-1]+'z-index:3;border-radius:50%"/>'
                }
                if (1){
                    qq=qq+1;
                    yangshi=yangshi+'<img src="Public/images/zhidaolan.gif" height="21" width="21" style="position:absolute; '+weizhi[qq-1]+' z-index:3;border-radius:50%"/>' ;
                }
                for (var ii=0;ii<dianbiaojisuoyin[i][1];ii++)   {
                    if (zhidaoxinxi[dianbiaojisuoyin[i][2+ii]]['isPay']==1){
                        qq=qq+1;
                        yangshi=yangshi+'<img src="Public/images/hongbaolan.gif" height="21" width="21" style="position:absolute; '+weizhi[qq-1]+'z-index:3;border-radius:50%"/>'
                        break;
                    }
                }

                if ((dangqianshijian-shijian)<1000000){
                    qq=qq+1;
                    yangshi=yangshi+'<img src="Public/images/xinlan.gif" height="21" width="21" style="position:absolute; '+weizhi[qq-1]+'z-index:3;border-radius:50%"/>'
                }
                yangshi=yangshi+'</div>';
                var marker = new AMap.Marker({
                    icon:touxiang ,
                    offset:new AMap.Pixel(-40,-40),
                    position:markerposition,
                    //content: '<div ><img src='+touxiang+' height="40" width="40" style="border-radius:50%"/></div>'
                    content:yangshi
                    /**
                    content: '<div >' +
                    '<img style="border-radius:50%;z-index:1;" src="Public/images/toumingbeijing.png" height="80" width="80" />' +
                    '<img src='+touxiang+' height="40" width="40" style="position:absolute; top:20px; left:20px; z-index:2;border:2px solid #C2C2C2;border-radius:50%"/>' +
                    '<img src="Public/images/renwu.gif" height="21" width="21" style="position:absolute; top:30px; left:-2px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                    '<img src="Public/images/xinlan.gif" height="21" width="21" style="position:absolute; top:8px; left:7px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                    '<img src="Public/images/hongbaolan.gif" height="21" width="21" style="position:absolute; top:-2px; left:30px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                    '<img src="Public/images/xinlan.gif" height="21" width="21" style="position:absolute; top:8px; left:52px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                    '<img src="Public/images/hongbaolan.gif" height="21" width="21" style="position:absolute; top:30px; left:61px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                    '<img src="Public/images/xinlan.gif" height="21" width="21" style="position:absolute; top:51px; left:52px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                    '<img src="Public/images/hongbaolan.gif" height="21" width="21" style="position:absolute; top:61px; left:30px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                    '</div>'
                     **/
                });
                   //自定义点标记覆盖物内容
                marker.setTitle('点击进来看看吧！');
                marker.setMap(map);  //在地图上添加点
                //q=1;
                //for (q=1;q<=dianbiaojisuoyin[i][1];q++){
                    marker.content = createInfoWindow(1,i);
                 //   marker.on('click', markerClick);
                 //   marker.emit('click', {target: marker});
                //console.log(marker);
                    map.clearInfoWindow();
               // }



               // AMap.event.addListener(marker, 'click', function (i) {
                    //var geshu=dianbiaojisuoyin[][1];

                //infoWindow.open(map, marker.getPosition());
                //    xinxichuangti(1,i);
                 //   infoWindow.open(map, marker.getPosition());
                 //});
                markers.push(marker);

            }
        //console.log(markers);
    }

    //infoWindow.Content=createInfoWindow(q,suoyin);
    //var position=[parseFloat(zhidaoxinxi[dianbiaojisuoyin[1][2]]['longitude'])+0.01,parseFloat(zhidaoxinxi[dianbiaojisuoyin[1][2]]['latitude'])];
    //dianji(2,0);


    function markerClick(e) {
        infoWindow.setContent(e.target.content);
        infoWindow.open(map, e.target.getPosition());
    }
    //鼠标点击marker弹出自定义的信息窗体
    //function xinxichuangti(q,suoyin)
   // {
    function dianji(q,suoyin) {
        //marker.content = createInfoWindow(q,suoyin);
       // infoWindow.setContent(e.target.content);
       // infoWindow.open(map, e.target.getPosition());
        var infoWindow1 = new AMap.InfoWindow({
            isCustom: true,  //使用自定义窗体
            content:createInfoWindow(q,suoyin),
            offset: new AMap.Pixel(14,-80)
        });
        //infoWindow.Content=createInfoWindow(q,suoyin);
        var position=[parseFloat(zhidaoxinxi[dianbiaojisuoyin[suoyin][2]]['longitude']),parseFloat(zhidaoxinxi[dianbiaojisuoyin[suoyin][2]]['latitude'])];
        infoWindow1.open(map, position);
    }
    function dianji1(dangqianyeshu,suoyin) {
        //marker.content = createInfoWindow(q,suoyin);
        // infoWindow.setContent(e.target.content);
        // infoWindow.open(map, e.target.getPosition());
        var infoWindow1 = new AMap.InfoWindow({
            isCustom: true,  //使用自定义窗体
            content:createInfoWindow1(dangqianyeshu,suoyin),
            offset: new AMap.Pixel(14,-80)
        });
        //infoWindow.Content=createInfoWindow(q,suoyin);
        infoWindow1.open(map,[cluster[ming][suoyin][ming01][0][ming03].position.lng,cluster[ming][suoyin][ming01][0][ming03].position.lat]);
    }
    function dianji2(dangqianyehsu,suoyin,q){
        //marker.content = createInfoWindow(q,suoyin);
        // infoWindow.setContent(e.target.content);
        // infoWindow.open(map, e.target.getPosition());
        var infoWindow1 = new AMap.InfoWindow({
            isCustom: true,  //使用自定义窗体
            content:cluster[ming][suoyin][ming01][rongnageshu*(dangqianyehsu-1)+q].content,
            offset: new AMap.Pixel(14,-80)
        });
        //infoWindow.Content=createInfoWindow(q,suoyin);
        //infoWindow1.open(map,[cluster[ming][suoyin][ming01][0][ming03].position.lng,cluster[ming][suoyin][ming01][0][ming03].position.lat]);
        infoWindow1.open(map,[cluster[ming][suoyin][ming01][rongnageshu*(dangqianyehsu-1)+q][ming03].position.lng,cluster[ming][suoyin][ming01][rongnageshu*(dangqianyehsu-1)+q][ming03].position.lat]);
    }

       // infoWindow = new AMap.InfoWindow({
        ///    isCustom: true,  //使用自定义窗体
         //   content: createInfoWindow(title,dibu,content.join("<br/>")),
         //   offset: new AMap.Pixel(16, -45)
        //});
        //   return infoWindow.open(map, marker.getPosition());

      //  }


    //实例化信息窗体
    //var title = zhidaoxinxi[dianbiaojisuoyin[i][2]]['taskTitle'], // '任务标题',  // <span style="font-size:11px;color:#F00;">出价:100</span>
    //content = [];
    //content.push("<img src='http://www.chuangyixingnong.com/Public/images/default_avatar_64_64.jpg'>任务内容：");
    //content.push("期限："+zhidaoxinxi[dianbiaojisuoyin[i][2]]['tasklimit']);
    //content.push("出价：3天");
    //content.push("出价："+zhidaoxinxi[dianbiaojisuoyin[i][2]]['taskContents']);
    //content.push("<a href='http://www.chuangyixingnong.com/index.php?s=/mob/task/taskdetail/taskSerialno/T201605081020086892.html'>任务详情</a>");

    //var infoWindow = new AMap.InfoWindow({
    //    isCustom: true,  //使用自定义窗体
    //    content: createInfoWindow(title, content.join("<br/>")),
    //    offset: new AMap.Pixel(16, -45)
    //});

    //构建自定义信息窗体
    function createInfoWindow(q, suoyin) {

        //实例化信息窗体
        var geshu=dianbiaojisuoyin[suoyin][1];
        var title=[],content = [],dibu=[];
        var biaoti=zhidaoxinxi[dianbiaojisuoyin[suoyin][1+q]]['Title'];
        var bytesshu;
        bytesshu=0;
        //console.log(biaoti);
        //console.log(biaoti.length);
        for (var i = 0; i < biaoti.length; i++) {
            var c = biaoti.charAt(i);
            if (/^[\u0000-\u00ff]$/.test(c)) //匹配双字节
             {
                 bytesshu = bytesshu+1;
             }
            else  {
                bytesshu = bytesshu+2;
            }
            if (bytesshu<=34){
                title =biaoti.substring(0,i+1);
            }
            else {
                title = title+'...';
                break;
            }
        }


        //var title = zhidaoxinxi[dianbiaojisuoyin[suoyin][1+q]]['taskTitle']+'速度速度和会计会计师对付款计划是打开了附件是地方绝对是离开', // '任务标题',  // <span style="font-size:11px;color:#F00;">出价:100</span>
         //content = [],dibu=[];
         //content.push("<img src='http://www.chuangyixingnong.com/Public/images/default_avatar_64_64.jpg'>任务内容："+zhidaoxinxi[dianbiaojisuoyin[suoyin][1+q]].taskContents);
        /**
        var neirong= zhidaoxinxi[dianbiaojisuoyin[suoyin][1+q]].taskContents;
        var neirong0=[];
        bytesshu=0;
        for ( i = 0; i < neirong.length; i++) {
             c = biaoti.charAt(i);
            if (/^[\u0000-\u00ff]$/.test(c)) //匹配双字节
            {
                bytesshu = bytesshu+1;
            }
            else  {
                bytesshu = bytesshu+2;
            }
            if (bytesshu<=115){
                neirong0 =neirong.substring(0,i+1);
            }
            else {

                neirong0 = neirong0+'...';
                break;
            }
        }

        content.push('<img src='+zhidaoxinxi[dianbiaojisuoyin[suoyin][1+q]].user.avatar128+'><span>任务内容：</span>'+neirong0);
         **/
        content.push('<img src='+zhidaoxinxi[dianbiaojisuoyin[suoyin][1+q]].user.avatar128+'>');
        //content.push('<img src="'+zhidaoxinxi[dianbiaojisuoyin[suoyin][1+q]].user.avatar128+'"'+'style="border-radius:50%"><span>任务内容：</span>'+neirong0);
        // console.log(neirong0.length);
        //content.push('<img src='+zhidaoxinxi[dianbiaojisuoyin[suoyin][1+q]].user.avatar128+'><span>任务内容：</span>'+neirong0);
         //content.push("<span>截止时间：</span>"+zhidaoxinxi[dianbiaojisuoyin[suoyin][1+q]]['tasklimit']);
        content.push("<span>发布者：</span>"+zhidaoxinxi[dianbiaojisuoyin[suoyin][1+q]].user.real_nickname);
        if (zhidaoxinxi[dianbiaojisuoyin[suoyin][1+q]].isPay==1){
            content.push("<span>红包：</span>是");
        }
        else {
            content.push("<span>红包：</span>否");
        }
        content.push("<span>发布时间：</span>"+zhidaoxinxi[dianbiaojisuoyin[suoyin][1+q]]['releaseTime'].substr(0,10));
        content.push("<span></span>          "+zhidaoxinxi[dianbiaojisuoyin[suoyin][1+q]]['releaseTime'].substr(11,8));
         //content.push("<span>红包：</span>"+zhidaoxinxi[dianbiaojisuoyin[suoyin][1+q]]['deliverMoney']);

         //content.push("出价：10");
        //

        content.push('<a  style="color:#0e90d2" href= /index.php?s=/mob/activity/actdetails/actId/'+ zhidaoxinxi[dianbiaojisuoyin[suoyin][1+q]].activityId+'.html target="_blank"><span>查看详情</span></a>');  //
        //var dizhi='location.href="/index.php?s=/mob/activity/actdetails/actId/'+zhidaoxinxi[dianbiaojisuoyin[suoyin][1+q]].activityId+'.html"';
        //content.push('<a class="vertical item " href="javascript:void(0)" onclick='+dizhi+'><span>查看详情</span></a>');
        //var title =  '任务标题',  // <span style="font-size:11px;color:#F00;">出价:100</span>
        //content = [],dibu=[];
        //content.push("<img src='http://www.chuangyixingnong.com/Public/images/default_avatar_64_64.jpg'>任务内容：");
        //content.push("期限：");
        //content.push("出价：3天");
        //content.push("出价："+zhidaoxinxi[suoyin[2]]['taskContents']);

//        var gujishijian=renwuneirong.length*100;
//        setTimeout('document.getElementByld("hanshu").style.display="";',gujishijian);

        // console.log(neirong0.length);




        //content.push('<a href= http://www.chuangyixingnong.com/index.php?s=/mob/task/taskdetail/taskSerialno.html>任务详情</a>');
        if (geshu==1){
            dibu='<span  style="color:#0e90d2" class="disabled">上一页</span><span style="color:#0e90d2" class="disabled">下一页</span>';
            //dibu='<span  style="color:#0e90d2" class="disabled">上一页</span>（'+q+'/'+geshu+'）<span style="color:#0e90d2" class="disabled">下一页</span>'
        }
        else {
            if (q==1){
                dibu='<span style="color:#0e90d2"  class="disabled">上一页</span>（'+q+'/'+geshu+'）<a style="color:#FFF" href=javascript:dianji('+(q+1)+','+suoyin+');><span>下一页</span></a>'
            }
            else{
                if (q==geshu){
                    dibu='<a style="color:#FFF" href=javascript:dianji('+(q-1)+','+suoyin+');><span>上一页</span></a>（'+q+'/'+geshu+'）<span style="color:#0e90d2" class="disabled">下一页</span>'
                }
                else {
                    dibu='<a style="color:#FFF" href=javascript:dianji('+(q-1)+','+suoyin+');><span>上一页</span></a>（'+q+'/'+geshu+'）<a  style="color:#FFF" href=javascript:dianji('+(q+1)+','+suoyin+');><span>下一页</span></a>'
                }
            }
        }
        content=content.join("<br/>");
        var info = document.createElement("div");
        info.className = "info";

        //可以通过下面的方式修改自定义窗体的宽高;
        //info.style.width = "400px";
        // 定义顶部标题
        var top = document.createElement("div");
        var titleD = document.createElement("div");
        var closeX = document.createElement("img");
        top.className = "info-top";
        titleD.innerHTML = title;
        closeX.src = "Public/images/close2.gif";
        closeX.onclick = closeInfoWindow;

        top.appendChild(titleD);
        top.appendChild(closeX);
        info.appendChild(top);

        // 定义中部内容
        var middle = document.createElement("div");
        middle.className = "info-middle";
        middle.style.backgroundColor = 'white';
        middle.innerHTML = content;
        info.appendChild(middle);

        // 定义底部内容
        var bottom = document.createElement("div");
        var dibuD = document.createElement("div");
        bottom.className = "info-bottom";
        dibuD.innerHTML = dibu;
       // bottom.style.position = 'relative';
       // bottom.style.top = '0px';
       // bottom.style.margin = '0 auto';
        var sharp = document.createElement("img");
        sharp.src = "Public/images/sharp.png";
        bottom.appendChild(dibuD);
        bottom.appendChild(sharp);
        info.appendChild(bottom);
        return info;
    }
    function createInfoWindow1(dangqianyehsu,suoyin) {

        //实例化信息窗体
        var geshu=cluster[ming][suoyin][ming01].length;
        rongnageshu=6;
        var yeshu=Math.ceil(geshu/rongnageshu);
        var title=[],content = [];
        //console.log(yeshu);
        //console.log(cluster[ming][suoyin]);
        //console.log(dangqianyehsu);
        //console.log(biaoti.length);
        title='';

        //content.push('<img src='+taskxinxi[dianbiaojisuoyin[suoyin][1+q]].user.avatar128+'><span>任务内容：</span>'+neirong0);
        //content.push('<img src="'+taskxinxi[dianbiaojisuoyin[suoyin][1+q]].user.avatar128+'"'+'style="border-radius:50%"><span>任务内容：</span>'+neirong0);
        // console.log(neirong0.length);
        //content.push('<img src='+taskxinxi[dianbiaojisuoyin[suoyin][1+q]].user.avatar128+'><span>任务内容：</span>'+neirong0);
        //content.push("<span>截止时间：</span>"+taskxinxi[dianbiaojisuoyin[suoyin][1+q]]['tasklimit']);
        //content.push("<span>任务人：</span>"+taskxinxi[dianbiaojisuoyin[suoyin][1+q]].user.real_nickname);
        //content.push("<span>出价：</span>"+taskxinxi[dianbiaojisuoyin[suoyin][1+q]]['deliverMoney']);

        //content.push("出价：10");
        var shuzhi;
        if(dangqianyehsu<yeshu){
            shuzhi=rongnageshu;
        }
        else {
            shuzhi=geshu-rongnageshu*(dangqianyehsu-1);
        }
        var touxiang=[];
        var houzhui=[];
        var content0=[];
        for (var q=0;q<shuzhi;q++){

            touxiang=cluster[ming][suoyin][ming01][rongnageshu*(dangqianyehsu-1)+q][ming03].icon;
            houzhui=touxiang.slice(touxiang.length-4,touxiang.length);
            //console.log(houzhui);
            // console.log(touxiang);
            touxiang=touxiang.slice(0,-10);
            touxiang=touxiang+'_128_128'+houzhui;
            /**
             content: '<div >' +
             '<img style="border-radius:50%;z-index:1;" src="Public/images/toumingbeijing.png" height="80" width="80" />' +
             '<img src='+touxiang+' height="40" width="40" style="position:absolute; top:20px; left:20px; z-index:2;border:2px solid #C2C2C2;border-radius:50%"/>' +
             '<img src="Public/images/renwu.gif" height="21" width="21" style="position:absolute; top:30px; left:-2px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
             '<img src="Public/images/xinlan.gif" height="21" width="21" style="position:absolute; top:8px; left:7px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
             '<img src="Public/images/hongbaolan.gif" height="21" width="21" style="position:absolute; top:-2px; left:30px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
             '<img src="Public/images/xinlan.gif" height="21" width="21" style="position:absolute; top:8px; left:52px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
             '<img src="Public/images/hongbaolan.gif" height="21" width="21" style="position:absolute; top:30px; left:61px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
             '<img src="Public/images/xinlan.gif" height="21" width="21" style="position:absolute; top:51px; left:52px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
             '<img src="Public/images/hongbaolan.gif" height="21" width="21" style="position:absolute; top:61px; left:30px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
             '</div>'
             **/
            //console.log(touxiang);
            //console.log(touxiang);
            //console.log(juhedian.Ba[10*(dangqianyehsu-1)+q].Pe.position);
            // console.log(juhedian.Ba[10*(dangqianyehsu-1)+q].content);
            //content0=content0+'<a href=javascript:dianji2('+dangqianyehsu+','+suoyin+','+q+');><img src='+touxiang+' height="52.8" width="52.8"  style="border-radius:50%"/>' +
            var yangshi=cluster[ming][suoyin][ming01][rongnageshu*(dangqianyehsu-1)+q][ming03].content;
            yangshi=yangshi.replace(/\<img/g,"<div><img");
            yangshi=yangshi.replace(/\/>/g,"/></div>");
            yangshi=yangshi.replace("<div ><div>", '<div style="position:relative;float: left;" >');
            yangshi=yangshi.replace("/></div>","/>");
            //var yangshi=cluster[ming][suoyin][ming01][rongnageshu*(dangqianyehsu-1)+q][ming03].content.slice(6,-6);
            //console.log(yangshi);
            /**
            yangshi= '<div style="position:relative;float: left;" ><img style="z-index:1;border-radius:50%;" src="Public/images/toumingbeijing.png" height="80" width="80" />' +
                    '<div><img src='+touxiang+'  height="40" width="40" style="position:absolute;top:20px; left:20px;z-index:2;border-radius:50%;border:2px solid #C2C2C2;"/></div>' +
                    '<div><img src="Public/images/renwu.gif" height="21" width="21" style="position:absolute; top:30px; left:-2px; z-index:3;background:#C2C2C2;border-radius:50%"/></div>' +
                    '<div><img src="Public/images/xinlan.gif" height="21" width="21" style="position:absolute; top:8px; left:7px; z-index:3;background:#C2C2C2;border-radius:50%"/></div>' +
                    '<div><img src="Public/images/hongbaolan.gif" height="21" width="21" style="position:absolute; top:-2px; left:30px; z-index:3;background:#C2C2C2;border-radius:50%"/></div>' +
                    '<div><img src="Public/images/xinlan.gif" height="21" width="21" style="position:absolute; top:8px; left:52px; z-index:3;background:#C2C2C2;border-radius:50%"/></div>' +
                    '<div><img src="Public/images/hongbaolan.gif" height="21" width="21" style="position:absolute; top:30px; left:61px; z-index:3;background:#C2C2C2;border-radius:50%"/></div>' +
                    '<div><img src="Public/images/xinlan.gif" height="21" width="21" style="position:absolute; top:51px; left:52px; z-index:3;background:#C2C2C2;border-radius:50%"/></div>' +
                    '<div><img src="Public/images/hongbaolan.gif" height="21" width="21" style="position:absolute; top:61px; left:30px; z-index:3;background:#C2C2C2;border-radius:50%"/></div></div>' ;
            **/
             content0=content0+'<a href=javascript:dianji2('+dangqianyehsu+','+suoyin+','+q+');>'+yangshi+'</a>';
            //content.push('<a href="http://www.w3school.com.cn/index.html"><img src='+touxiang+' height="50" width="50"  style="border-radius:50%"/></a>');   //height="40" width="40" style="border-radius:50%"

        }
        content.push(content0);
        //content.push('<a href= http://www.chuangyixingnong.com/index.php?s=/mob/task cvnvcvvvfbfffvccvvv                          egsd/**//taskdetail/taskSerialno/'+ taskxinxi[dianbiaojisuoyin[suoyin][1+q]].taskSerialno+'.html target="_blank">任务详情</a>');
        //var title =  '任务标题',  // <span style="font-size:11px;color:#F00;">出价:100</span>
        //       content = [],dibu=[];
        //content.push("<img src='http://www.chuangyixingnong.com/Public/images/default_avatar_64_64.jpg'>任务内容：");
        // content.push("期限：");
        //  content.push("出价：3天");
        //content.push("出价："+taskxinxi[suoyin[2]]['taskContents']);

        //content.push('<a href= http://www.chuangyixingnong.com/index.php?s=/mob/task/taskdetail/taskSerialno.html>任务详情</a>');

        if (yeshu==1){
            dibu='<span style="color:#0e90d2"  class="disabled">上一页</span><span style="color:#0e90d2" class="disabled">下一页</span>';
            //dibu='<span style="color:#0e90d2"  class="disabled">上一页</span>（'+dangqianyehsu+'/'+yeshu+'）<span style="color:#0e90d2" class="disabled">下一页</span>'
        }
        else {
            if (dangqianyehsu==1){
                dibu='<span style="color:#0e90d2" class="disabled">上一页</span>（'+dangqianyehsu+'/'+yeshu+'）<a  style="color:#FFF" href=javascript:dianji1('+(dangqianyehsu+1)+','+suoyin+');><span>下一页</span></a>'
            }
            else{
                if (dangqianyehsu==yeshu){
                    dibu='<a  style="color:#FFF" href=javascript:dianji1('+(dangqianyehsu-1)+','+suoyin+');><span>上一页</span></a>（'+dangqianyehsu+'/'+yeshu+'）<span style="color:#0e90d2" class="disabled">下一页</span>'
                }
                else {
                    dibu='<a style="color:#FFF"  href=javascript:dianji1('+(dangqianyehsu-1)+','+suoyin+');><span>上一页</span></a>（'+dangqianyehsu+'/'+yeshu+'）<a  style="color:#FFF" href=javascript:dianji1('+(dangqianyehsu+1)+','+suoyin+');><span>下一页</span></a>'
                }
            }
        }
        content=content.join("<br/>");
        var info = document.createElement("div");
        info.className = "info";

        //可以通过下面的方式修改自定义窗体的宽高
        //info.style.width = "400px";
        // 定义顶部标题
        var top = document.createElement("div");
        var titleD = document.createElement("div");
        var closeX = document.createElement("img");
        top.className = "info-top";
        titleD.innerHTML = title;
        closeX.src = "Public/images/close2.gif";
        closeX.onclick = closeInfoWindow;

        top.appendChild(titleD);
        top.appendChild(closeX);
        info.appendChild(top);

        // 定义中部内容
        var middle = document.createElement("div");
        middle.className = "info-middle1";
        middle.style.backgroundColor = 'white';
        middle.innerHTML = content;
        info.appendChild(middle);

        // 定义底部内容
        var bottom = document.createElement("div");
        var dibuD = document.createElement("div");
        bottom.className = "info-bottom";
        dibuD.innerHTML = dibu;
        // bottom.style.position = 'relative';
        // bottom.style.top = '0px';
        // bottom.style.margin = '0 auto';
        var sharp = document.createElement("img");
        sharp.src = "Public/images/sharp.png";
        bottom.appendChild(dibuD);
        bottom.appendChild(sharp);
        info.appendChild(bottom);
        return info;
    }
    //关闭信息窗体
    function closeInfoWindow() {
        map.clearInfoWindow();
        addmarker1();
       // markers.setMap(map);
       // markers1.setMap(map);
    }

    //function Juhe(){
    //    setTimeout(function(){
    //        addCluster(1); e
    //    },500);
    //}
    function addCluster(tag)
    {
        //var markers1=[];
        if(cluster) {
            cluster.setMap(null);
            map.remove(markers1);
        }
        if(tag==1) {
            var sts=[{url:"Public/images/beijinglan.png",size:new AMap.Size(24,24),offset:new AMap.Pixel(-35,12),imageOffset:new AMap.Pixel(0,0),textColor:"#FFFFFF",textSize:10},  //textOffset:new AMap.Pixel(10, 0)
                {url:"Public/images/beijinglan.png",size:new AMap.Size(24,24),offset:new AMap.Pixel(-35,12),imageOffset:new AMap.Pixel(0,0),textColor:"#FFFFFF",textSize:10},
                {url:"Public/images/beijinglan.png",size:new AMap.Size(24,24),offset:new AMap.Pixel(-35,12),imageOffset:new AMap.Pixel(0,0),textColor:"#FFFFFF",textSize:10}];

            // var sts=[{url:"Public/images/juhetubiao.png",size:new AMap.Size(20,20),offset:new AMap.Pixel(-19,7),imageOffset:new AMap.Pixel(61,0),textSize:10},  //textOffset:new AMap.Pixel(10, 0)
            //     {url:"Public/images/juhetubiao.png",size:new AMap.Size(20,20),offset:new AMap.Pixel(-19,7),imageOffset:new AMap.Pixel(82,0),textSize:10},
            //    {url:"Public/images/juhetubiao2.png",size:new AMap.Size(26,26),offset:new AMap.Pixel(-22,4),imageOffset:new AMap.Pixel(0,0),textSize:10}];
            map.plugin(["AMap.MarkerClusterer"],function(){
               // for (var i=0;i<zhidaoxinxi.length;i++){
                //    console.log(zhidaoxinxi[i].user.avatar32);
                    //console.log(markers[i].content.textContent);
                //}
                cluster = new AMap.MarkerClusterer(map,markers,{styles:sts});
            });
        }
        else {
            map.plugin(["AMap.MarkerClusterer"], function () {
                cluster = new AMap.MarkerClusterer(map, markers);
            });
        }
        addmarker1();
        //for (var i=0;i<cluster.dj.length;i++){
       //     for (var q=0;q<5;q++){
        //        cluster.dj[i].qg.kB[q].url=cluster.dj[i].Pa[0].H.icon;
        //    }
       // }
        //console.log(map);//onCameraChangeFinish
        AMap.event.addListener(map,'moveend',function(){
            addmarker1();
        });
        AMap.event.addListener(map,'zoomchange',function(){
            //console.log(cluster);
            //  map.remove(markers1);
            //   map.remove(markers1);
            //  markers1 = null;

            //removeMarkers(markers1);
            addmarker1();
        });
        AMap.event.addListener(map,'zoomend',function(){
            //console.log(cluster);
            // map.remove(markers1);
            //  markers1 = null;
            //removeMarkers(markers1);
            addmarker1();
        });
        AMap.event.addListener(map,'dragend',function(){
            addmarker1();
        });
        AMap.event.addListener(map,'touchend',function(){
            addmarker1();
        });
        AMap.event.addListener(map,'resize',function(){
            //console.log(cluster);
         //map.remove(markers1);
         // markers1 = null;

            //removeMarkers(markers1);
            addmarker1();
        });
        AMap.event.addListener(map,'complete',function(){
            //console.log(cluster);
          //  map.remove(markers1);
        //   markers1 = null;
           // removeMarkers(markers1);
            addmarker1();
        });


        AMap.event.addDomListener(document.getElementById('addMarkers'), 'click', function() {
            addmarker1();
        }, false);
          //  AMap.event.addListener(map,'moveend',function(){
                //console.log(cluster);
          //      addmarker1();
         //   });
        //AMap.OnCameraChangeListener(this);

        //AMap.event.addListener(cluster, 'change', function(){

        //});
        //    AMap.event.addListener(cluster, 'click', function(){
        //    cluser=event.srcElement;
        //    cluser=event.srcElement;
        //    console.log(cluser);
        //});
       //obj(obj = event.srcElement ? event.srcElement : event.target;)

    }
    function getItemsArr(obj,idx)
    {
        var i=0;
        for(var item in obj)
        {
            i=i+1;
            if (i==idx){
                break;
            }
        }
        return item;
    }

    function addmarker1(){
        if (markers1){
            for (var j=0;j<markers1.length;j++){
                markers1[j].setMap(null);
            }

            // map.remove(markers1);
        }
        //console.log(markers1);
       // console.log(markers);
        markers1=[];
        var q=0;
        jilu=[];
        //var juhedian;
        ming =getItemsArr(cluster,10);
        if (cluster[ming].length>0){
            ming01=getItemsArr(cluster[ming][0],8);
            ming02=getItemsArr(cluster[ming][0][ming01][0],3);
            ming03=getItemsArr(cluster[ming][0][ming01][0],4);
        }
       // console.log(ming01);
        //console.log(ming02);
       // console.log(ming03);
        //console.log(cluster[ming].length);
        //console.log(cluster.dj.length);
        //for (var i=0;i<cluster.dj.length;i++){
        for (var i=0;i<cluster[ming].length;i++){
            // $.each(cluster.dj, function(i, item) {

            //  marker.Pe.position= juhedian.Pa[0].Pe.position;
            //  marker.H.position= juhedian.Pa[0].H.position;
            //   marker = juhedian.Pa[0];
            //var dandianjuhexinxi=[];
            //dandianjuhexinxi=getByClass(juhexinxi(i),"AMap.Marker");
            if (cluster[ming][i][ming01].length>1) {
                //console.log(i);
                var weizhi=["top:30px; left:-2px;","top:8px; left:7px;","top:-2px; left:30px;","top:8px; left:52px;","top:30px; left:61px;","top:51px; left:52px;","top:61px; left:30px;"];


                var yangshi= '<div >' +
                        '<img style="border-radius:50%;z-index:1;" src="Public/images/toumingbeijing.png" height="80" width="80" />' +
                        '<img src='+cluster[ming][i][ming01][0][ming02].icon+' height="40" width="40" style="position:absolute; top:20px; left:20px; z-index:2;border:2px solid #fff;border-radius:50%"/>';
                var qq=0;
                /**
                for (var jj= 0;jj<cluster[ming][i][ming01].length;jj++){
                    var sousou = cluster[ming][i][ming01][jj][ming02].content.indexOf("Public/images/zhidaolan.gif");
                    if (sousou>0){
                        qq=qq+1;
                        yangshi=yangshi+'<img src="Public/images/zhidaolan.gif" height="21" width="21" style="position:absolute; '+weizhi[qq-1]+' z-index:3;background:#C2C2C2;border-radius:50%"/>' ;
                        break;
                    }
                }
                 **/
                for ( jj= 0;jj<cluster[ming][i][ming01].length;jj++){
                    sousou = cluster[ming][i][ming01][jj][ming02].content.indexOf("Public/images/zhidaogehong.gif");
                    if (sousou>0){
                        qq=qq+1;
                        yangshi=yangshi+'<img src="Public/images/zhidaogehong.gif" height="21" width="21" style="position:absolute; '+weizhi[qq-1]+'z-index:3;border-radius:50%"/>';
                        break;
                    }
                }
                if (1){
                    qq=qq+1;
                    yangshi=yangshi+'<img src="Public/images/zhidaolan.gif" height="21" width="21" style="position:absolute; '+weizhi[qq-1]+'z-index:3;border-radius:50%"/>';
                }
                for ( jj= 0;jj<cluster[ming][i][ming01].length;jj++){
                    var sousou = cluster[ming][i][ming01][jj][ming02].content.indexOf("Public/images/hongbaolan.gif");
                    if (sousou>0){
                        qq=qq+1;
                        yangshi=yangshi+'<img src="Public/images/hongbaolan.gif" height="21" width="21" style="position:absolute; '+weizhi[qq-1]+'z-index:3;border-radius:50%"/>' ;
                        break;
                    }
                }
                for ( jj= 0;jj<cluster[ming][i][ming01].length;jj++){
                    sousou = cluster[ming][i][ming01][jj][ming02].content.indexOf("Public/images/xinlan.gif");
                    if (sousou>0){
                        qq=qq+1;
                        yangshi=yangshi+'<img src="Public/images/xinlan.gif" height="21" width="21" style="position:absolute; '+weizhi[qq-1]+'z-index:3;border-radius:50%"/>';
                        break;
                    }
                }
                yangshi=yangshi+'</div>';

                var marker = new AMap.Marker({
                    icon:cluster[ming][i][ming01][0][ming02].icon ,
                    offset:new AMap.Pixel(-40,-40),
                    //animation:"AMAP_ANIMATION_BOUNCE",
                    position:[cluster[ming][i][ming01][0][ming02].position.lng,cluster[ming][i][ming01][0][ming02].position.lat],
                    //content: '<div ><img src='+cluster[ming][i][ming01][0][ming02].icon+' height="40" width="40" style="border:2px solid #C2C2C2;border-radius:50%"/></div>'
                    content:yangshi
                    /**
                    content: '<div >' +
                    '<img style="border-radius:50%;z-index:1;" src="Public/images/toumingbeijing.png" height="80" width="80" />' +
                    '<img src='+cluster[ming][i][ming01][0][ming02].icon+' height="40" width="40" style="position:absolute; top:20px; left:20px; z-index:2;border:2px solid #C2C2C2;border-radius:50%"/>' +
                    '<img src="Public/images/renwu.gif" height="21" width="21" style="position:absolute; top:30px; left:-2px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                    '<img src="Public/images/xinlan.gif" height="21" width="21" style="position:absolute; top:8px; left:7px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                    '<img src="Public/images/hongbaolan.gif" height="21" width="21" style="position:absolute; top:-2px; left:30px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                    '<img src="Public/images/xinlan.gif" height="21" width="21" style="position:absolute; top:8px; left:52px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                    '<img src="Public/images/hongbaolan.gif" height="21" width="21" style="position:absolute; top:30px; left:61px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                    '<img src="Public/images/xinlan.gif" height="21" width="21" style="position:absolute; top:51px; left:52px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                    '<img src="Public/images/hongbaolan.gif" height="21" width="21" style="position:absolute; top:61px; left:30px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                    '</div>'
                     **/
                });

                marker.setTitle('点击进来看看吧！');
                marker.zIndex = 99;
                marker[ming02].zIndex = 99;
                marker[ming03].zIndex = 99;
                //console.log(cluster);
                //console.log(marker);
                marker.setMap(map);
                //            marker.setTitle('不要犹豫进来看看吧！');
                // 设置label标签
                marker.content = createInfoWindow1(1, i);
                //marker.on('click', markerClick);
               // marker.emit('click', {target: marker});
                //console.log(marker);
                //console.log(cluster);
               // console.log(marker);
              //  console.log(cluster[ming][i][ming01].length);
             //   map.clearInfoWindow();
                markers1.push(marker);
                //markers1[q]=marker;
                jilu[q]=i;
                q=q+1;
            }
            else{
                 marker = new AMap.Marker({
                    icon:cluster[ming][i][ming01][0][ming02].icon ,
                    offset:new AMap.Pixel(-40,-40),
                    //animation:"AMAP_ANIMATION_BOUNCE",
                    position:[cluster[ming][i][ming01][0][ming02].position.lng,cluster[ming][i][ming01][0][ming02].position.lat],
                    //content: '<div ><img src='+cluster[ming][i][ming01][0][ming02].icon+' height="40" width="40" style="border:2px solid #C2C2C2;border-radius:50%"/></div>'
                    content:cluster[ming][i][ming01][0][ming02].content
                    /**
                     content: '<div >' +
                     '<img style="border-radius:50%;z-index:1;" src="Public/images/toumingbeijing.png" height="80" width="80" />' +
                     '<img src='+cluster[ming][i][ming01][0][ming02].icon+' height="40" width="40" style="position:absolute; top:20px; left:20px; z-index:2;border:2px solid #C2C2C2;border-radius:50%"/>' +
                     '<img src="Public/images/renwu.gif" height="21" width="21" style="position:absolute; top:30px; left:-2px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                     '<img src="Public/images/xinlan.gif" height="21" width="21" style="position:absolute; top:8px; left:7px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                     '<img src="Public/images/hongbaolan.gif" height="21" width="21" style="position:absolute; top:-2px; left:30px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                     '<img src="Public/images/xinlan.gif" height="21" width="21" style="position:absolute; top:8px; left:52px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                     '<img src="Public/images/hongbaolan.gif" height="21" width="21" style="position:absolute; top:30px; left:61px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                     '<img src="Public/images/xinlan.gif" height="21" width="21" style="position:absolute; top:51px; left:52px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                     '<img src="Public/images/hongbaolan.gif" height="21" width="21" style="position:absolute; top:61px; left:30px; z-index:3;background:#C2C2C2;border-radius:50%"/>' +
                     '</div>'
                     **/
                });

                marker.setTitle('点击进来看看吧！');
                marker.zIndex = 101;
                marker[ming02].zIndex = 101;
                marker[ming03].zIndex = 101;
                //console.log(cluster);
                //console.log(marker);
                marker.setMap(map);
                //            marker.setTitle('不要犹豫进来看看吧！');
                // 设置label标签
                marker.content = cluster[ming][i][ming01][0].content;
               // marker.on('click', markerClick);
               // marker.emit('click', {target: marker});
                //console.log(marker);
                //console.log(cluster);
                // console.log(marker);
                //  console.log(cluster[ming][i][ming01].length);
               // map.clearInfoWindow();
                markers1.push(marker);
                //markers1[q]=marker;
            }
            //else {
            //    marker.setMap(map);
            //    markers1[q]=marker;
            //    q=q+1;
           // }
        }

        $.each(markers1, function(i, item) {
            //  for ( i = 0; i < dianbiaojishu; i++) {
            if (cluster[ming][i][ming01].length==1){
                var infoWindow = new AMap.InfoWindow({
                    isCustom: true,  //使用自定义窗体
                    content:cluster[ming][i][ming01][0].content,
                    offset: new AMap.Pixel(14, -80)
                });
                AMap.event.addListener(item, 'click', function() {
                    infoWindow.open(map,item.getPosition());
                });
            }
            else {
                 infoWindow = new AMap.InfoWindow({
                    isCustom: true,  //使用自定义窗体
                    content:createInfoWindow1(1,i),
                    offset: new AMap.Pixel(14, -80)
                });
                AMap.event.addListener(item, 'click', function() {
                    infoWindow.open(map,item.getPosition());
                });
            }

        });

        //});
    }        //125.279345,43.823261

    //for (var i=0; i<5; i++)
    //
    //    x=x + "The number is " + i + "<br>";
    //}
</script>


</div>



        <!-- /主体 -->

        <!-- 底部 -->
        <div class="hide-foot am-text-center" style="display: none"><!-- 用于加载统计代码等隐藏元素 -->
    <?php echo ($count_code); ?>
    
</div>
        <!-- /底部 -->
    </body>
</html>